package springboot.rabbit.springbootrabbit;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by Arat.Wu on 2018/05/30.
 */
@Component
@Slf4j
@RabbitListener(queues = "my")
public class myQueueReceive {

        @RabbitHandler
        public void process(String hello) throws JsonProcessingException {
            ObjectMapper objectMapper= new ObjectMapper();
            String jsonString=objectMapper.writeValueAsString(hello);
            log.debug("Receiver1  : " + hello);
        }
}
